<template>
	<view class="" style="padding: 20rpx;">
		<u-parse class="parse" :html="content" @linkpress="onlinkTap"></u-parse>
		<u-modal :show="show" :cancelText="cancelText" @confirm="confirm" @cancel="cancel"
			:confirmText="confirmText" :title="title" :showCancelButton="true" :content='content'></u-modal>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				content:"",
				show:false,
				urllinks:"",
				cancelText: this.$t('user.cancel'),
				confirmText: this.$t('user.yes'),
				content: this.$t('user.open'),
				title: this.$t('user.prompt'),
			}
		},
		onLoad(e) {
			this.getinfo(e)
		},
		methods:{
			cancel() {
				this.show = false
			},
			confirm() {
				this.show = false
				plus.runtime.openURL(this.urllinks)
			},
			onlinkTap(e) {
				e.ignore()
				console.log(e)
				this.show = true
				this.urllinks = e.href
			},
			getinfo(e){
				const params = {
					map: e.url
				}
				this.$Request({
					method: 'GET',
					data: params
				}).then(res => {
					if (res.data.ec == 200) {
						console.log(res)
						this.content = res.data.data
					} else {
						
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.parse{
		font-size: 24rpx;
	}
</style>